/**
 * Window Displays Character's Information
 */
package View;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JPanel;
import java.awt.Color;
import javax.swing.JButton;
import javax.swing.JLabel;
import java.awt.Font;

/**
 * This class displays character's current information. 
 * The window is accessed from the Player Window
 * when the "Character" button is pressed
 * @author Whitney
 * @version 1.0
 */
public class PlayerInfoWindow extends JPanel{
	
	/**
	 * The Return Button
	 */
	private final JButton btnReturn;

	/**
	 * Return Value Initial
	 */
	private int buttonPressed = -1;
	
	/**
	 * Constructor for PlayerInfoWindow
	 */
	public PlayerInfoWindow() {
		setBackground(Color.LIGHT_GRAY);
		setLayout(null);
		
		btnReturn = new JButton("Return");
		btnReturn.setBounds(20, 248, 117, 29);
		add(btnReturn);
		
		final JLabel lblName = new JLabel("Name:");
		lblName.setForeground(Color.ORANGE);
		lblName.setFont(new Font("Krungthep", Font.PLAIN, 17));
		lblName.setBounds(20, 26, 61, 16);
		add(lblName);
		
		final JLabel lblSkills = new JLabel("Skills:");
		lblSkills.setFont(new Font("Krungthep", Font.PLAIN, 17));
		lblSkills.setForeground(Color.ORANGE);
		lblSkills.setBounds(20, 64, 61, 16);
		add(lblSkills);
		
	}

	/**
	 * This class handles the buttons for player info Window
	 * @author Whitney
	 *
	 */
	private class ButtonListener implements ActionListener{
		/**
		 * Handles the events thrown
		 * @param event The button pressed event
		 */
		public void actionPerformed (ActionEvent event){
			if(event.getSource().equals(btnReturn)){
				buttonPressed = 1;
			}
		}
	}
	
	/**
	 * Returns the button pressed
	 * @return the value of the button pressed
	 */
	public int getButtonPressed(){
		return buttonPressed;
	}
}
